package principal;

import java.awt.*;
import java.util.*;


public class GestionnaireDeSelection extends Observable {

    private static GestionnaireDeSelection instance;
    private Component selectionne;
    
    
    private GestionnaireDeSelection(){
        
       selectionne=null;
    }
    
    public static GestionnaireDeSelection getInstance(){
        
        if(instance==null) instance=new GestionnaireDeSelection();
        
        return instance;
    }
    
    public void setComposantSelectionne(Component c){
        
        this.selectionne=c;
        this.setChanged();
        this.notifyObservers();
        this.clearChanged();
    }
    
    public boolean hasTheSelection(Component c){
        
        return this.selectionne.equals(c);
    }
}
